﻿@model AntUnion.FrameWork.Model.Models.EmailSetting
@{
    ViewData["Title"] = "WebEdit";
    Layout = "~/Areas/Console/Views/Shared/_Layout.cshtml";
}
@section head{
    <style>
        .layui-form-label {
            width: 150px;
        }
    </style>
    <script type="text/javascript">
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table', 'form', 'upload', 'laydate'], function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , table = layui.table
                , upload = layui.upload
                , layedit = layui.layedit
                , laydate = layui.laydate
                , parentFrameIndex = parent.layer.getFrameIndex(window.name); //获取窗口索引;

            //时间选择器
            laydate.render({
                elem: '#settlementTime'
                , type: 'time'
            });

            function GetBaseData(language, type) {
                $.getJSON("/Console/SystemConfig/GetSystemConfigsByLanguage?language=" + language, function (result) {
                    let plat = result.data;
                    if (type === 0) {
                        $("#webFrontName").val("");
                        $("#webAfterName").val("");
                        $("#webFrontTitle").val("");
                        $("#webAfterTitle").val("");
                        $("#onlineService").val("");
                        $("#registrationWarmPrompt").val("");
                        $("#userAgreement").val("");
                        $("#privacyClause").val("");
                        $("#loginWarmPrompt").val("");
                        $("#passwordWarmPrompt").val("");
                        $("#personalCenterWarmPrompt").val("");
                        $("#financeWarmPrompt").val("");
                        $("#withdrawalWarmPrompt").val("");
                        $("#rechargeWarmPrompt").val("");
                        $("#maintenanceExplain").val("");
                        plat.forEach(function (v) {
                            switch (v.menuName) {
                                case "webFrontName":
                                    $("#webFrontName").val(v.value);
                                    break;
                                case "webAfterName":
                                    $("#webAfterName").val(v.value);
                                    break;
                                case "webFrontTitle":
                                    $("#webFrontTitle").val(v.value);
                                    break;
                                case "webAfterTitle":
                                    $("#webAfterTitle").val(v.value);
                                    break;
                                case "onlineService":
                                    $("#onlineService").val(v.value);
                                    break;
                                case "registrationWarmPrompt":
                                    $("#registrationWarmPrompt").val(v.value);
                                    break;
                                case "userAgreement":
                                    $("#userAgreement").val(v.value);
                                    break;
                                case "privacyClause":
                                    $("#privacyClause").val(v.value);
                                    break;
                                case "loginWarmPrompt":
                                    $("#loginWarmPrompt").val(v.value);
                                    break;
                                case "passwordWarmPrompt":
                                    $("#passwordWarmPrompt").val(v.value);
                                    break;
                                case "personalCenterWarmPrompt":
                                    $("#personalCenterWarmPrompt").val(v.value);
                                    break;
                                case "financeWarmPrompt":
                                    $("#financeWarmPrompt").val(v.value);
                                    break;
                                case "withdrawalWarmPrompt":
                                    $("#withdrawalWarmPrompt").val(v.value);
                                    break;
                                case "rechargeWarmPrompt":
                                    $("#rechargeWarmPrompt").val(v.value);
                                    break;
                                case "maintenanceExplain":
                                    $("#maintenanceExplain").val(v.value);
                                    break;
                            }
                        });
                    } else if (type === 1) {
                        $("#webFrontName").val("");
                        $("#webAfterName").val("");
                        $("#webFrontTitle").val("");
                        $("#webAfterTitle").val("");
                        $("#onlineService").val("");
                        $("#maintenanceExplain").val("");
                        plat.forEach(function (v) {
                            switch (v.menuName) {
                                case "webFrontName":
                                    $("#webFrontName").val(v.value);
                                    break;
                                case "webAfterName":
                                    $("#webAfterName").val(v.value);
                                    break;
                                case "webFrontTitle":
                                    $("#webFrontTitle").val(v.value);
                                    break;
                                case "webAfterTitle":
                                    $("#webAfterTitle").val(v.value);
                                    break;
                                case "onlineService":
                                    $("#onlineService").val(v.value);
                                    break;
                                case "maintenanceExplain":
                                    $("#maintenanceExplain").val(v.value);
                                    break;
                            }
                        });
                    } else if (type === 2) {
                        $("#registrationWarmPrompt").val("");
                        $("#userAgreement").val("");
                        $("#privacyClause").val("");
                        $("#loginWarmPrompt").val("");
                        $("#passwordWarmPrompt").val("");
                        $("#personalCenterWarmPrompt").val("");
                        $("#financeWarmPrompt").val("");
                        $("#withdrawalWarmPrompt").val("");
                        $("#rechargeWarmPrompt").val("");
                        plat.forEach(function (v) {
                            switch (v.menuName) {
                                case "registrationWarmPrompt":
                                    $("#registrationWarmPrompt").val(v.value);
                                    break;
                                case "userAgreement":
                                    $("#userAgreement").val(v.value);
                                    break;
                                case "privacyClause":
                                    $("#privacyClause").val(v.value);
                                    break;
                                case "loginWarmPrompt":
                                    $("#loginWarmPrompt").val(v.value);
                                    break;
                                case "passwordWarmPrompt":
                                    $("#passwordWarmPrompt").val(v.value);
                                    break;
                                case "personalCenterWarmPrompt":
                                    $("#personalCenterWarmPrompt").val(v.value);
                                    break;
                                case "financeWarmPrompt":
                                    $("#financeWarmPrompt").val(v.value);
                                    break;
                                case "withdrawalWarmPrompt":
                                    $("#withdrawalWarmPrompt").val(v.value);
                                    break;
                                case "rechargeWarmPrompt":
                                    $("#rechargeWarmPrompt").val(v.value);
                                    break;
                            }
                        });
                    }
                });
            }
            GetBaseData($("#language").val(), 0);
            /**多语言初始化 */
            top.SetFormPageLanguage(layui);
            var systemMaintenance = "@ViewBag.systemMaintenance";
            // 指定开关事件
            form.on('switch(systemMaintenance)', function (data) {
                if (this.checked) {
                    systemMaintenance = "1";
                } else {
                    systemMaintenance = "0";
                }
            });
            /* 监听提交 */
            form.on('submit(submit-form)', function (data) {
                if (data.field.language.length <= 0) {
                    top.AlertByKey(layui, "pleaseSelectLanguage", 0);
                    return false;
                }
                if (data.field.webFrontName.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterWebFrontName", 0);
                    return false;
                }
                if (data.field.webAfterName.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterWebAfterName", 0);
                    return false;
                }
                if (data.field.webFrontTitle.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterWebFrontTitle", 0);
                    return false;
                }
                if (data.field.webAfterTitle.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterWebAfterTitle", 0);
                    return false;
                }
                if (data.field.onlineService.length <= 0) {
                    top.AlertByKey(layui, "enterOnlineService", 0);
                    return false;
                }
                data.field.systemMaintenance = systemMaintenance;
                $.ajax({
                    type: "POST",
                    url: "/Console/SystemConfig/WebEdit",
                    data: data.field, // 你的formid
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, "submitSuccess", 6, 1000, function () {
                                parent.layer.close(parentFrameIndex);
                                parent.renderTable();
                            });
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
            upload.render({
                elem: '#webFrontLogoDiv,#btnWebFrontLogo'
                , url: '/Console/SystemConfig/UploadFile'
                , size: 100
                , done: function (res) {
                    $("#webFrontLogo").val(res.data.src);
                    $("#webFrontLogoIcon").addClass('layui-hide');
                    $('#webFrontLogoView').removeClass('layui-hide').find('img').attr('src', res.data.src);
                }
            });

            upload.render({
                elem: '#webAfterLogoDiv,#btnWebAfterLogo'
                , url: '/Console/SystemConfig/UploadFile'
                , size: 100 //限制文件大小，单位 KB
                , done: function (res) {
                    $("#webAfterLogo").val(res.data.src);
                    $("#webAfterLogoIcon").addClass('layui-hide');
                    $('#webAfterLogoView').removeClass('layui-hide').find('img').attr('src', res.data.src);
                }
            });

            upload.render({
                elem: '#backgroundImageDiv,#btnBackgroundImage'
                , url: '/Console/SystemConfig/UploadFile'
                , size: 2000 //限制文件大小，单位 KB
                , done: function (res) {
                    $("#backgroundImage").val(res.data.src);
                    $("#backgroundImageIcon").addClass('layui-hide');
                    $('#backgroundImageView').removeClass('layui-hide').find('img').attr('src', res.data.src);
                }
            });
            $('#removeWebFrontLogo').click(function () {
                $("#webFrontLogoIcon").removeClass('layui-hide');
                $('#webFrontLogoView').val('').addClass('layui-hide').find('img').attr('src', '');
                $("#webFrontLogo").val("");
            });
            $('#removeWebAfterLogo').click(function () {
                $("#webAfterLogoIcon").removeClass('layui-hide');
                $('#webAfterLogoView').val('').addClass('layui-hide').find('img').attr('src', '');
                $("#webAfterLogo").val("");
            });
            $('#removeBackgroundImage').click(function () {
                $("#backgroundImageIcon").removeClass('layui-hide');
                $('#backgroundImageView').val('').addClass('layui-hide').find('img').attr('src', '');
                $("#backgroundImage").val("");
            });

            $('#viewWebFrontLogo').click(function () {
                var src = $("#imgWebFrontLogo").attr("src");
                if (src) {
                    previewImg(src);
                }
            });
            $('#viewWebAfterLogo').click(function () {
                var src = $("#imgWebAfterLogo").attr("src");
                if (src) {
                    previewImg(src);
                }
            });
            $('#viewBackgroundImage').click(function () {
                var src = $("#imgBackgroundImage").attr("src");
                if (src) {
                    previewImg(src);
                }
            });

            //共用设置
            form.on('submit(submitLogoSettings)', function (data) {
                if (data.field.defaultLanguage.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterDefaultLanguage", 0);
                    return false;
                }
                if (data.field.weburl.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterWebsiteDomainName", 0);
                    return false;
                }
                if (data.field.settlementTime.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterSettlementTime", 0);
                    return false;
                }
                if (data.field.webFrontLogo.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterWebFrontLogo", 0);
                    return false;
                }
                if (data.field.webAfterLogo.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterWebAfterLogo", 0);
                    return false;
                }
                if (data.field.backgroundImage.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterBackgroundImage", 0);
                    return false;
                }
                $.ajax({
                    type: "POST",
                    url: "/Console/SystemConfig/WebLogoSettings",
                    data: data.field, // 你的formid
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, "submitSuccess", 6, 1000, function () {
                                parent.layer.close(parentFrameIndex);
                                parent.renderTable();
                            });
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });

            function previewImg(src) {
                var imgHtml = "<div style='overflow:auto;display:flex;align-items:center;width:700px;height:700px;justify-content:center;'>"
                    + "<img style='width:auto;height:auto;text-align:center;' src='" + src + "' /></div>";
                //弹出层
                layer.open({
                    type: 1,
                    shade: true,
                    shade: [0.4, '#000000'],
                    title: false, //不显示标题
                    area: ['auto', 'auto'],
                    content: imgHtml, //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
                    cancel: function () {

                    }
                });
            }

            form.on('select(defaultLanguage)', function (data) {
                GetBaseData(data.value, 1);
            });

            form.on('select(warmPromptLanguage)', function (data) {
                GetBaseData(data.value, 2);
            });

            /* 监听提交 */
            form.on('submit(submitEmailSettings)', function (data) {
                if (data.field.Supplier.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterSupplier", 0);
                    return false;
                }
                if (data.field.Address.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterSMTPAddress", 0);
                    return false;
                }
                if (data.field.Port.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterPort", 0);
                    return false;
                }
                if (data.field.Account.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterloginAccount", 0);
                    return false;
                }
                if (data.field.Password.length <= 0) {
                    top.AlertByKey(layui, "enterLoginPassword", 0);
                    return false;
                }
                if (data.field.Email.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterOutboundEmail", 0);
                    return false;
                }
                if (data.field.From.length <= 0) {
                    top.AlertByKey(layui, "pleaseEnterSendPeople", 0);
                    return false;
                }
                $.ajax({
                    type: "POST",
                    url: "/Console/EmailSetting/Edit",
                    data: data.field, // 你的formid
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, "submitSuccess", 6, 1000, function () {
                                parent.layer.close(parentFrameIndex);
                                parent.renderTable();
                            });
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });

            /* 温馨提示 */
            form.on('submit(warmPrompt)', function (data) {
                if (data.field.language.length <= 0) {
                    top.AlertByKey(layui, "pleaseSelectLanguage", 0);
                    return false;
                }
                if (data.field.registrationWarmPrompt.length <= 0) {
                    top.AlertByKey(layui, "incompleteInformation", 0);
                    return false;
                }
                if (data.field.userAgreement.length <= 0) {
                    top.AlertByKey(layui, "incompleteInformation", 0);
                    return false;
                }
                if (data.field.privacyClause.length <= 0) {
                    top.AlertByKey(layui, "incompleteInformation", 0);
                    return false;
                }
                if (data.field.loginWarmPrompt.length <= 0) {
                    top.AlertByKey(layui, "incompleteInformation", 0);
                    return false;
                }
                if (data.field.passwordWarmPrompt.length <= 0) {
                    top.AlertByKey(layui, "incompleteInformation", 0);
                    return false;
                }
                if (data.field.personalCenterWarmPrompt.length <= 0) {
                    top.AlertByKey(layui, "incompleteInformation", 0);
                    return false;
                }
                if (data.field.financeWarmPrompt.length <= 0) {
                    top.AlertByKey(layui, "incompleteInformation", 0);
                    return false;
                }
                if (data.field.withdrawalWarmPrompt.length <= 0) {
                    top.AlertByKey(layui, "incompleteInformation", 0);
                    return false;
                }
                if (data.field.rechargeWarmPrompt.length <= 0) {
                    top.AlertByKey(layui, "incompleteInformation", 0);
                    return false;
                }
                $.ajax({
                    type: "POST",
                    url: "/Console/SystemConfig/WarmPromptEdit",
                    data: data.field, // 你的formid
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, "submitSuccess", 6, 1000, function () {
                                parent.layer.close(parentFrameIndex);
                                parent.renderTable();
                            });
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, "submitFail", 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
        });
    </script>
}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
                <ul class="layui-tab-title">
                    <li lay-event="basicSettings" class="layui-this">基础设置</li>
                    <li lay-event="publicData">共用信息</li>
                    <li lay-event="emailSettings">发件邮箱设置</li>
                    <li lay-event="warmPrompt">温馨提示</li>
                </ul>
                <div class="layui-tab-content">
                    <div id="basicSettings" class="layui-tab-item layui-show">
                        <div class="layui-form">
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="language">默认语言</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <select name="language" id="language" lay-filter="defaultLanguage">
                                        @if (ViewBag.defaultLanguage == "zh-CN")
                                        {
                                            <option value="zh-CN" selected="selected">简体中文</option>
                                            <option value="en-US">English</option>
                                        }
                                        else
                                        {
                                            <option value="zh-CN">简体中文</option>
                                            <option value="en-US" selected="selected">English</option>
                                        }
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="webFrontName">网站前端名称</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="webFrontName" id="webFrontName" placeholder="pleaseEnterWebFrontName" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="webAfterName">网站后端名称</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="webAfterName" id="webAfterName" placeholder="pleaseEnterWebAfterName" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="webFrontTitle">网站前端Title</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="webFrontTitle" id="webFrontTitle" placeholder="pleaseEnterWebFrontTitle" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="webAfterTitle">网站后端Title</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="webAfterTitle" id="webAfterTitle" placeholder="pleaseEnterWebAfterTitle" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="onlineService">在线客服</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="onlineService" name="onlineService" placeholder="enterOnlineService" class="layui-textarea">@ViewBag.onlineService</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="systemMaintenance">维护状态</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    @if (ViewBag.systemMaintenance == "1")
                                    {
                                        <input type="checkbox" id="systemMaintenance" name="systemMaintenance" lay-skin="switch" lay-filter="systemMaintenance" title="ON|OFF" checked="checked">
                                    }
                                    else
                                    {
                                        <input type="checkbox" id="systemMaintenance" name="systemMaintenance" lay-skin="switch" lay-filter="systemMaintenance" title="ON|OFF">
                                    }
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="maintenanceExplain">维护说明</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="maintenanceExplain" name="maintenanceExplain" placeholder="enterMaintenanceExplain" class="layui-textarea">@ViewBag.maintenanceExplain</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item layui-layout-admin">
                                <div class="layui-input-block">
                                    <div class="layui-footer" style="left: 0;">
                                        <button class="layui-btn" lay-event="confirmBtn" lay-submit="" lay-filter="submit-form">立即提交</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form">
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="defaultLanguage">默认语言</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <select name="defaultLanguage" id="defaultLanguage">
                                        @if (ViewBag.defaultLanguage == "zh-CN")
                                        {
                                            <option value="zh-CN" selected="selected">简体中文</option>
                                            <option value="en-US">English</option>
                                        }
                                        else
                                        {
                                            <option value="zh-CN">简体中文</option>
                                            <option value="en-US" selected="selected">English</option>
                                        }
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="websiteDomainName">网站域名</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="weburl" id="weburl" value="@ViewBag.weburl" placeholder="pleaseEnterWebsiteDomainName" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="settlementTime">结算时间</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="settlementTime" id="settlementTime" value="@ViewBag.settlementTime" placeholder="HH:mm:ss" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="webFrontLogo">网站前端Logo</label>
                                <div class="layui-upload-drag" id="webFrontLogoDiv">
                                    @if (string.IsNullOrEmpty(ViewBag.webFrontLogo))
                                    {
                                        <i id="webFrontLogoIcon" class="layui-icon layui-show"></i>
                                        <div class="layui-hide" id="webFrontLogoView">
                                            <img src="" style="max-width: 120px" id="imgWebFrontLogo">
                                            <input type="hidden" name="webFrontLogo" id="webFrontLogo" class="layui-input">
                                        </div>
                                    }
                                    else
                                    {
                                        <i id="webFrontLogoIcon" class="layui-icon layui-hide"></i>
                                        <div class="layui-show" id="webFrontLogoView">
                                            <img src="@ViewBag.webFrontLogo" style="max-width: 120px" id="imgWebFrontLogo">
                                            <input type="hidden" name="webFrontLogo" id="webFrontLogo" value="@ViewBag.webFrontLogo" class="layui-input">
                                        </div>
                                    }
                                </div>
                                <button type="button" class="layui-btn" id="btnWebFrontLogo" lay-event="changeOne">换一张</button>
                                <button type="button" class="layui-btn layui-btn-danger" id="removeWebFrontLogo" lay-event="remove">移除</button>
                                <button type="button" class="layui-btn layui-btn-primary" id="viewWebFrontLogo" lay-event="view">查看</button>
                                <div class="layui-inline layui-word-aux" lay-event="webFrontLoginSize">
                                    建议上传图片尺寸：300px：300px
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="webAfterLogo">网站前端Logo</label>
                                <div class="layui-upload-drag" id="webAfterLogoDiv">
                                    @if (string.IsNullOrEmpty(ViewBag.webAfterLogo))
                                    {
                                        <i id="webAfterLogoIcon" class="layui-icon layui-show"></i>
                                        <div class="layui-hide" id="webAfterLogoView">
                                            <img src="" style="max-width: 120px" id="imgWebAfterLogo">
                                            <input type="hidden" name="webAfterLogo" id="webAfterLogo" class="layui-input">
                                        </div>
                                    }
                                    else
                                    {
                                        <i id="webAfterLogoIcon" class="layui-icon layui-hide"></i>
                                        <div class="layui-show" id="webAfterLogoView">
                                            <img src="@ViewBag.webAfterLogo" style="max-width: 120px" id="imgWebAfterLogo">
                                            <input type="hidden" name="webAfterLogo" id="webAfterLogo" value="@ViewBag.webAfterLogo" class="layui-input">
                                        </div>
                                    }
                                </div>
                                <button type="button" class="layui-btn" id="btnWebAfterLogo" lay-event="changeOne">换一张</button>
                                <button type="button" class="layui-btn layui-btn-danger" id="removeWebAfterLogo" lay-event="remove">移除</button>
                                <button type="button" class="layui-btn layui-btn-primary" id="viewWebAfterLogo" lay-event="view">查看</button>
                                <div class="layui-inline layui-word-aux" lay-event="webAfterLoginSize">
                                    建议上传图片尺寸：300px：300px
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="backgroundImage">网站前端Logo</label>
                                <div class="layui-upload-drag" id="backgroundImageDiv">
                                    @if (string.IsNullOrEmpty(ViewBag.backgroundImage))
                                    {
                                        <i id="backgroundImageIcon" class="layui-icon layui-show"></i>
                                        <div class="layui-hide" id="backgroundImageView">
                                            <img src="" style="max-width: 120px" id="imgWebAfterLogo">
                                            <input type="hidden" name="backgroundImage" id="backgroundImage" class="layui-input">
                                        </div>
                                    }
                                    else
                                    {
                                        <i id="backgroundImageIcon" class="layui-icon layui-hide"></i>
                                        <div class="layui-show" id="backgroundImageView">
                                            <img src="@ViewBag.backgroundImage" style="max-width: 120px" id="imgBackgroundImage">
                                            <input type="hidden" name="backgroundImage" id="backgroundImage" value="@ViewBag.backgroundImage" class="layui-input">
                                        </div>
                                    }
                                </div>
                                <button type="button" class="layui-btn" id="btnBackgroundImage" lay-event="changeOne">换一张</button>
                                <button type="button" class="layui-btn layui-btn-danger" id="removeBackgroundImage" lay-event="remove">移除</button>
                                <button type="button" class="layui-btn layui-btn-primary" id="viewBackgroundImage" lay-event="view">查看</button>
                                <div class="layui-inline layui-word-aux" lay-event="webBackgroundImageSize">
                                    建议上传图片尺寸：1920px：1080px
                                </div>
                            </div>
                            <div class="layui-form-item layui-layout-admin">
                                <div class="layui-input-block">
                                    <div class="layui-footer" style="left: 0;">
                                        <button class="layui-btn" lay-event="confirmBtn" lay-submit="" lay-filter="submitLogoSettings">立即提交</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form">
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="supplier">供应商</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="Supplier" id="Supplier" value="@Model.Supplier" placeholder="pleaseEnterSupplier" class="layui-input">
                                    @Html.HiddenFor(k => k.Id)
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="SMTPAddress">SMTP地址</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="Address" id="Address" value="@Model.Address" placeholder="pleaseEnterSMTPAddress" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="port">端口</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="number" name="Port" id="Port" value="@Model.Port" placeholder="pleaseEnterPort" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="loginAccount">登录账号</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="Account" id="Account" value="@Model.Account" placeholder="pleaseEnterloginAccount" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="loginPassword">登录密码</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="Password" id="Password" value="@Model.Password" placeholder="enterLoginPassword" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="outboundEmail">发件邮箱</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="Email" id="Email" value="@Model.Email" placeholder="pleaseEnterOutboundEmail" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="sendPeople">发件人</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <input type="text" name="From" id="From" value="@Model.From" placeholder="pleaseEnterSendPeople" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item layui-layout-admin">
                                <div class="layui-input-block">
                                    <div class="layui-footer" style="left: 0;">
                                        <button class="layui-btn" lay-event="confirmBtn" lay-submit lay-filter="submitEmailSettings">立即提交</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form">
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="language">默认语言</label>
                                <div class="layui-input-inline" style="width:300px;">
                                    <select name="language" id="language" lay-filter="warmPromptLanguage">
                                        @if (ViewBag.defaultLanguage == "zh-CN")
                                        {
                                            <option value="zh-CN" selected="selected">简体中文</option>
                                            <option value="en-US">English</option>
                                        }
                                        else
                                        {
                                            <option value="zh-CN">简体中文</option>
                                            <option value="en-US" selected="selected">English</option>
                                        }
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="registrationWarmPrompt">注册提示</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="registrationWarmPrompt" name="registrationWarmPrompt" class="layui-textarea">@ViewBag.registrationWarmPrompt</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="userAgreement">用户协议</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="userAgreement" name="userAgreement" class="layui-textarea">@ViewBag.userAgreement</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="privacyClause">隐私条款</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="privacyClause" name="privacyClause" class="layui-textarea">@ViewBag.privacyClause</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="loginWarmPrompt">登录提示</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="loginWarmPrompt" name="loginWarmPrompt" class="layui-textarea">@ViewBag.loginWarmPrompt</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="passwordWarmPrompt">忘记密码</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="passwordWarmPrompt" name="passwordWarmPrompt" class="layui-textarea">@ViewBag.passwordWarmPrompt</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="personalCenterWarmPrompt">个人信息</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="personalCenterWarmPrompt" name="personalCenterWarmPrompt" class="layui-textarea">@ViewBag.personalCenterWarmPrompt</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="financeWarmPrompt">财务信息</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="financeWarmPrompt" name="financeWarmPrompt" class="layui-textarea">@ViewBag.financeWarmPrompt</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="withdrawalWarmPrompt">提现提示</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="withdrawalWarmPrompt" name="withdrawalWarmPrompt" class="layui-textarea">@ViewBag.withdrawalWarmPrompt</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label" lay-event="rechargeWarmPrompt">充值提示</label>
                                <div class="layui-input-inline" style="width:600px;">
                                    <textarea id="rechargeWarmPrompt" name="rechargeWarmPrompt" class="layui-textarea">@ViewBag.rechargeWarmPrompt</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item layui-layout-admin">
                                <div class="layui-input-block">
                                    <div class="layui-footer" style="left: 0;">
                                        <button class="layui-btn" lay-event="confirmBtn" lay-submit="" lay-filter="warmPrompt">立即提交</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>